package com.xms.core.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * PagedList
 * </p>
 *
 * @author migo
 * @since 2021/9/12
 */
public class PagedList<T> implements Serializable
{
    public PagedList()
    {
    }
    public PagedList(int page, int size, long total)
    {
        this.currentpage = page;
        this.itemsperpage = size;
        this.totalitems = total;
    }
    public PagedList(List<T> datas, int page, int size, long total, long pages)
    {
        this.items = datas;
        this.currentpage = page;
        this.itemsperpage = size;
        this.totalitems = total;
        this.totalpages = pages;
    }
    @JsonProperty("currentpage")
    public int currentpage;
    @JsonProperty("items")
    public List<T> items;
    @JsonProperty("itemsperpage")
    public int itemsperpage;
    @JsonProperty("totalitems")
    public long totalitems;
    @JsonProperty("totalpages")
    public long totalpages;
}
